Repository navigation
test(e2e): run the git merge suite's git through gitexec - #1179
sbalabanov wants to merge 1 commit into
Conversation
sbalabanov
left a comment
There was a problem hiding this comment.
[flaky-1-d2-reviewer] nit: no must-fix; one optional nit inline. I checked that gitexec.Output builds a fresh environment for every git call in the suite: the scrub set plus PATH with the pinned git's directory first. runGit is the suite's only git path. git-upload-pack, git-receive-pack and git-upload-archive are copies of :git in the same Bazel package, so fetch, clone, push and the rev-list --exclude-hidden=fetch connectivity check all resolve to the pinned build. Git's stderr still reaches the failure message through CommandError.Error(); only the bare exit status is dropped when stderr is non-empty. The diff matches the spec and the Tango precedent. The implementer worktree's three after-fix runs show only the e2e-submitqueue-git stack and end in PASS. The PR body has a TLDR, a Test Plan that matches what was run, and no Revert Plan or Issue Links sections.
TestGitMergeE2E failed on every run on hosts whose /usr/bin/git is older than the pinned git, with "fatal: unsupported section for hidden refs: fetch" from git fetch. The suite ran the pinned git with exec.Command and the inherited environment. The pinned binary's compiled-in exec path does not exist, so its sub-commands resolve git from PATH, which under Bazel's strict environment is the older system git. Host git config also applied to the test repositories. Routing runGit through gitexec.Output puts the pinned git's directory first on PATH and scrubs host git config, matching what the Tango suite already does. That makes the clone's commit.gpgsign and core.hooksPath overrides dead, so they are removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
dfad2dc to
5cb720b
Compare
sbalabanov
left a comment
There was a problem hiding this comment.
[flaky-1-d2-reviewer] nit: The code at 5cb720b looks good. The PR body is still accurate, but it no longer covers the whole change. Squash commits on main carry the PR body, so removing commit.gpgsign and the .no-hooks core.hooksPath block from configureWorkClone would land with no explanation; only the amended commit body mentions it. Suggest one Summary bullet, e.g. "configureWorkClone drops its commit.gpgsign and core.hooksPath overrides, which the scrub makes dead."
I checked that nothing relied on the removed lines:
- Both were set only in the work clone's local config. Runway never reads it; it merges through the bare repo.
- With system and global config scrubbed, only repo-local config can turn on signing or set
core.hooksPath. The test writes that config itself, andclonedoes not copy it from the source. - The pinned git is built without
RUNTIME_PREFIX, so its default template dir is/share/git-core/templates, which does not exist here.GIT_TEMPLATE_DIRandinit.templateDircannot reach git, so the clone gets no active hooks. .no-hookswas an empty directory:git add .never tracked it and nothing asserted on it.- The
os,filepathandrequireimports are still used, and gofmt is clean. - The implementer worktree's three runs at 21:21Z, just before the amend (the tree is clean at 5cb720b), each brought up only
e2e-submitqueue-gitand ended in PASS.
|
[flaky-1-d2-implementer] fixed in PR body: added a Summary bullet noting that the dead commit.gpgsign and core.hooksPath settings are removed from configureWorkClone, and why. |
TLDR:
TestGitMergeE2Enow runs git throughgitexec, so it passes on hosts whose system git is older than the pinned git.Summary
GitMergeSuite.runGitran the pinned git withexec.Commandand the inherited environment. The pinned binary's compiled-in exec path does not exist, so its sub-commands fell back to the systemgitonPATH, and host git config applied. On a host with git 2.39 this failed withfatal: unsupported section for hidden refs: fetch.runGitnow callsgitexec.Output, which puts the pinned git's directory first onPATHand scrubs host git config. This is the same helper the Tango suite already uses.configureWorkCloneno longer setscommit.gpgsignor acore.hooksPathpointing at an empty directory.gitexecignores system and global config, so these repo-local overrides no longer guard anything.Test Plan
Run locally (needs Docker):
/usr/bin/git2.39.5: 3/3 failed with the hidden-refs error.make fmt lint check-gazelle check-tidy: all pass (run on the committed tree).grep -rn 'exec.Command(s.git' test/e2ereturns nothing.🤖 Generated with Claude Code